<?php

include_once("config.php");
include_once("db_connect.php");
include_once("restrito.php");

//pegar o id do evento ativo na sessao
if(isset($_SESSION["eventoAtivo"])){
	$eventoAtivo = unserialize($_SESSION["eventoAtivo"]);
}

$operacao = "Inscrições";
$dica = "Inscritos no evento."; 

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Eventos Acadêmicos</title>
<link href="blueprint/screen.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.0/jquery.validate.js" ></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>

<script src="js/functions.js"></script>
<script>
  /*$(function() {
    
 // setup graphic EQ
    $( "#main_content > table tr td select" ).each(function() {
	//fabio
	var span_id = this.id;
	//alert(span_id);
	var select = $( "#" + span_id );
    var slider = $( "<div id='slider" + span_id +"'></div>" ).insertAfter( select ).slider({
      min: 1,
      max: 5,
      range: "min",
      value: select[ 0 ].selectedIndex + 1,
      slide: function( event, ui ) {
        select[ 0 ].selectedIndex = ui.value - 1;
      }
    });
    $( "#" + span_id ).change(function() {
      slider.slider( "value", this.selectedIndex + 1 );
    });

    });
  });*/
  </script>
  <style>
  #eq span {
    width:120px; float:left; margin:15px
  }
  </style>
</head>
<body>
<!--<div id="mask"></div>-->


<div id="wrapper">

<div id="header">
	<div id="logo_instituicao">
    	<img src="<?php echo $logo_instituicao; ?>" alt="Logo" />
    </div>
    <div id="logo_sistema">
    	<img src="<?php echo $logo_sistema; ?>" alt="" />
    </div>
</div>
<div id="content">
	<div id="sidebar">
    	<?php include("user_info_inc.php"); ?>
        <?php loadMenu("evento");?>
    </div>
    <div id="main_content">
   	    <div id="notifications">
   	  		<?php include("notification_inc.php"); ?>
   	  	</div>
      

      <div id="boxTitlePage">
		 <span class="title"><?php echo utf8_encode( $eventoAtivo->getNome() ). " > " .$operacao; ?></span>
		 <span><?php echo $dica;?></span>
	  </div>
      
      <a href="controller/inscricaoController.php?action=novo" class="botao_right botaoGoogleBlue">Nova Inscrição</a>
        
      <table width="100%" border="0">
  <tr>
    <th scope="col">NOME</th>
    <th scope="col">CPF</th>
    <th scope="col">RG</th>
    <th scope="col">INSCRITO EM</th>
    <th scope="col">PARTICIPAÇÃO</th>
  </tr>
  <?php
  //listar aqui apenas os inscritos do evento
  //$dql = "SELECT i, e FROM Inscricao i JOIN i.evento e WHERE e.id = '".$eventoAtivo->getId()."'";
  //$query = $entityManager->createQuery($dql);
  //$inscricoes = $query->getResult();
  //foreach($inscricoes as $inscricao){
  

  foreach($listaPresenca as $item){
  	$inscricao = $item;
  
  
  ?>
  <tr>
    <td><?php echo utf8_encode( $inscricao->getParticipante()->getNome() );?></td>
    <td><?php echo utf8_encode( $inscricao->getParticipante()->getCPF() );?></td>
    <td><?php echo utf8_encode( $inscricao->getParticipante()->getRG() );?></td>
    <td><?php echo $inscricao->getDataInscricao()->format("d/m/Y H:i:s") ;?></td>
    <!-- <td><input type="checkbox" name="compareceram[]" value="<?php //echo $inscricao->getParticipante()->getId(); ?>"/></td> -->
    <td width="40">
    <!-- <form id="reservation"> -->
  		<!-- <label for="select_<?php //echo $inscricao->getParticipante()->getId(); ?>">Minimum number of beds</label> -->
  		<!-- <select name="select_<?php //echo $inscricao->getParticipante()->getId(); ?>" id="select_<?php //echo $inscricao->getParticipante()->getId(); ?>">
    		<option>Não Participou</option>
    		<option>Participou pouco (25%)</option>
    		<option>Participou metade (50%)</option>
    		<option>Participou mais da metade (75%)</option>
    		<option>Participou tudo</option>
  		</select> -->
	<!-- </form> -->
	<input type="text" name="participacao_<?php echo $inscricao->getParticipante()->getId(); ?>" id="participacao_<?php echo $inscricao->getParticipante()->getId(); ?>" value="<?php echo $inscricao->getPercentagemParticipacao(); ?>" />
	</td>
    
  </tr>
  <?php
  }
  ?>
</table>
        
        
    </div>
</div>
<div id="footer">
	<div id="developers">
    	<img src="<?php echo $logo_developer; ?>" />
    </div>
    <div id="footer_address">
    	<?php echo $nome_faculdade_completo; ?><br />
        <?php echo $endereco_faculdade; ?>
    </div>
</div>
</div><!-- fecha wrapper-->

</body>
</html>
